<?php

namespace App\Admin\Extensions\Form;

use Dcat\Admin\Form\Field\Select;
use Dcat\Admin\Widgets\Checkbox;
class SelectTwo extends Select
{
    protected $view = 'admin.form.select-two';

    protected $options1 = [];



    public function options1($arr){
        $this->options1 = $arr;
        if ($arr instanceof \Closure) {
            $this->options1 = $arr->call($this);
        }
        $this->addVariables([
            'options1'    => $this->options1
        ]);
        return $this;
    }

    public function render()
    {
        $model = $this->values();
        $column = $this->column;
        $value =  $this->value();
        $arr = explode('.',$value);
        $this->addVariables([
            'value' => $model?$model[$column]:'',
            'value1' => isset($arr[0])?$arr[0]:0,
            'value2' => isset($arr[1])?$arr[1]:0,
            'options1'    => $this->options1
        ]);
        return parent::render();

    }

    

   
}